package com.jinmdz.fmis.common.model;

/**
 * Poi.Cell
 *
 * @author LiCongLu
 * @date 2020-01-02 14:39
 */
public class PoiCell implements Comparable<PoiCell> {
    /**
     * 行数
     */
    private int rowNum;

    /**
     * 列索引
     */
    private int columnIndex;

    /**
     * 单元格值
     */
    private String cellValue;

    public int getRowNum() {
        return rowNum;
    }

    public PoiCell setRowNum(int rowNum) {
        this.rowNum = rowNum;
        return this;
    }

    public int getColumnIndex() {
        return columnIndex;
    }

    public PoiCell setColumnIndex(int columnIndex) {
        this.columnIndex = columnIndex;
        return this;
    }

    public String getCellValue() {
        return cellValue;
    }

    public PoiCell setCellValue(String cellValue) {
        this.cellValue = cellValue;
        return this;
    }

    @Override
    public int compareTo(PoiCell o) {
        if (o == null) {
            return 1;
        }
        if (this.columnIndex == o.columnIndex) {
            return this.getCellValue().compareTo(o.cellValue);
        }
        return this.columnIndex > o.columnIndex ? 1 : -1;
    }
}
